Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support deep link swap pairs and to tokenId #5216

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

MuckT
Copy link
Collaborator

@MuckT MuckT commented Apr 10, 2024

Description

Adds the route param toTokenId to the SwapScreenWithBack screen allowing the use of a deep link to set the to tokenId.
This enables the creation of deep link which contains a swap pair or a target to token.

Test plan

Prerequisites:

Tests urls:

  • Swap pair: celo://wallet/openScreen?screen=SwapScreenWithBack&fromTokenId=celo-mainnet:native&toTokenId=celo-mainnet:0x765de816845861e75a25fca122bb6898b8b1282a
  • From token: celo://wallet/openScreen?screen=SwapScreenWithBack&fromTokenId=celo-mainnet:native
  • To token: celo://wallet/openScreen?screen=SwapScreenWithBack&toTokenId=celo-mainnet:native
  • No tokens: celo://wallet/openScreen?screen=SwapScreenWithBack

Related issues

N/A

Backwards compatibility

Yes

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

Copy link

emerge-tools bot commented Apr 10, 2024

1 build increased size

Name Version Download Change Install Change Approval
⚠️ Celo (test)
org.celo.mobile.test
1.82.0 (147) 26.8 MB ⬆️ 2.4 MB (9.72%) 63.7 MB ⬆️ 2.7 MB (4.42%) N/A

Celo (test) 1.82.0 (147)
org.celo.mobile.test

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 2.7 MB (4.42%)
Total download size change: ⬆️ 2.4 MB (9.72%)

Largest size changes

Item Install Size Change
📝 splashBackground@3x.jpg ⬆️ 600.2 kB
📝 background@3x.jpg ⬆️ 368.6 kB
📝 boost-rewards@3x.png ⬆️ 188.4 kB
📝 background@2x.jpg ⬆️ 176.1 kB
📝 boost-rewards@2x.png ⬆️ 90.1 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.77%. Comparing base (4311924) to head (bd873f7).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5216   +/-   ##
=======================================
  Coverage   85.77%   85.77%           
=======================================
  Files         744      744           
  Lines       30351    30353    +2     
  Branches     5240     5241    +1     
=======================================
+ Hits        26033    26035    +2     
  Misses       4079     4079           
  Partials      239      239           
Files Coverage Δ
src/swap/SwapScreen.tsx 94.40% <100.00%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4311924...bd873f7. Read the comment docs.

Copy link
Contributor

@bakoushin bakoushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@MuckT MuckT added this pull request to the merge queue Apr 12, 2024
Merged via the queue into main with commit d27051e Apr 12, 2024
17 checks passed
@MuckT MuckT deleted the tomm/deeplink-swap-pair-0 branch April 12, 2024 14:39
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
### Description

Adds the route param toTokenId to the SwapScreenWithBack screen allowing
the use of a deep link to set the to tokenId.
This enables the creation of deep link which contains a swap pair or a
target to token.

### Test plan

Prerequisites:
- Remove `isSecureOrigin` from
https://github.com/valora-inc/wallet/blob/main/src/app/saga.ts#L348 for
local testing.
- Use iOS mainnetDev with `yarn dev:ios -e mainnetdev`

Tests urls:
- Swap pair:
`celo://wallet/openScreen?screen=SwapScreenWithBack&fromTokenId=celo-mainnet:native&toTokenId=celo-mainnet:0x765de816845861e75a25fca122bb6898b8b1282a`
- From token:
`celo://wallet/openScreen?screen=SwapScreenWithBack&fromTokenId=celo-mainnet:native`
- To token:
`celo://wallet/openScreen?screen=SwapScreenWithBack&toTokenId=celo-mainnet:native`
- No tokens: `celo://wallet/openScreen?screen=SwapScreenWithBack`

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants